package com.qth.valet.common.utils;

import com.fasterxml.jackson.databind.ObjectMapper;

import java.util.Map;

public class CustomJsonUtil {

    public static <T> T convertMapToObject(Map<?, ?> map, Class<T> clazz) {
        try {
            return new ObjectMapper().convertValue(map, clazz);
        } catch (IllegalArgumentException e) {
            throw new RuntimeException("转换失败: " + e.getMessage(), e);
        }
    }

}
